<?php

/**
 * Created by PhpStorm.
 * Author: ls
 * Time: 2023/8/23 11:26
 * Desc:租车请求验证
 */
class Request_Api_V2_Techan extends Request_Api_V2_Base
{
    public function __construct($request_param)
    {
        parent::__construct($request_param);
    }

    public function index_recommend()
    {
        $this->rules = [
            ['row', ['digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function get_list()
    {
        $this->rules = [
            ['page', ['digit', $this->rule_min(0)]],
            ['pagesize', ['digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function get_detail()
    {
        $this->rules = [
            ['id', ['not_empty', 'digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function suit_list()
    {
        $this->rules = [
            ['id', ['not_empty', 'digit', $this->rule_min(1)]],
            ['suit_id', ['digit', $this->rule_min(1)]],
            ['together_id', ['digit', $this->rule_min(0)]],
            ['is_seckill', ['digit', $this->rule_min(0)]],
        ];

        return $this;
    }

    public function get_express_fee()
    {
        $this->rules = [
            ['suit_id', ['not_empty', 'digit', $this->rule_min(1)]],
            ['address_id', ['digit', $this->rule_min(1)]],
            ['dingnum', ['digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function create_order()
    {
        $this->rules = [
            ['productid', ['not_empty', 'digit', $this->rule_min(1)]],
            ['suitid', ['not_empty', 'digit', $this->rule_min(1)]],
            ['dingnum', ['not_empty', 'digit', $this->rule_min(1)]],
            ['linktel', ['not_empty', 'phone']],
            ['linkman', ['not_empty']],
            ['linkemail', ['email']],
            ['receive_phone', ['phone']],
            ['express_plan_id', ['digit', $this->rule_min(0)]],
        ];

        //自定义规则
        $this->validation->rule('mid',array('Rule_Member','need_member'));

        return $this;
    }
}